package com.koko.interceptor;

import com.koko.context.FeignContext;
import feign.RequestInterceptor;
import feign.RequestTemplate;

/**
 * feign请求时携带的JWTtoken令牌
 */
public class FeignJwtTokenInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        String token = FeignContext.getCurrentToken();
        requestTemplate.header("Authorization", token);
    }
}
